import { IContext, IParam } from '@/core';
import { PropType } from 'vue';

declare type editStyle = 'default' | 'tree';

export const CascaderProps = {
	editorStyle: {
		type: String as PropType<editStyle>,
		default: 'default',
	},
	value: {
		type: String,
		default: '',
	},
	name: {
		type: String,
        default: '',
	},
	data: {
		type: Object as PropType<IParam>,
		default: () => {}
	},
	context: {
		type: Object as PropType<IContext>,
		default: () => {}
	},
	viewParams: {
		type: Object as PropType<IParam>,
		default: () => {}
	},
	disabled: {
		type: String,
	},
	filterable: {
		type: Boolean,
        default: true,
	},
	separator: {
		type: String,
		default:'/'
	},
	placeholder: {
		type: String,
	},
	readonly: {
		type: String,
	},
	multiple: {
		type: Boolean,
        default: false
	},
	valueItems: {
		type: Array as PropType<ValueItemType[]>,
		default: []
	},
	size: {
		type: String,
        default: 'default'
	},
	clearable: {
		type: Boolean,
		default: true
	},
};
export interface ValueItemType {

	/**
	 * 值项名称
	 *
	 * @type {string}
	 * @memberof ValueItemType
	 */
	name: string;

	/**
	 * 值项关联实体名称
	 *
	 * @type {string}
	 * @memberof ValueItemType
	 */
	appDataEntity: string;

	/**
	 * 值项关联数据集名称
	 *
	 * @type {string}
	 * @memberof ValueItemType
	 */
	dataSet: string;
}
